<script src="/include/calendar/calendar.js"></script>
<div class="pageheader">
	<h2>
		<i class="fa fa-inbox"></i>库存管理
	</h2>
	<div class="breadcrumb-wrapper">
		<span class="label">你所在的位置：</span>
		<ol class="breadcrumb">
			<li><a href="/index">ERP管理系统</a></li>
			<li>库存管理</li>
			<li class="active">库存增删记录</li>
		</ol>
	</div>
</div>
<div class="contentpanel">
<div class="main">
    <form class="form-inline" method="post" action="/stock/deladd" style="margin-bottom: 10px;">
		<div class="form-group">
			<label for="sku">SKU</label> <input type="text" value="<?php echo $this->sku;?>" class="form-control" name="sku">
		</div>
        <div class="form-group">
            <label for="Site">操作</label>
            <select class='form-control' name='isadd'>
                <option value='' <?php if($this->isadd == ''){echo 'selected="selected"';}?>>选择</option>
                <option value='0' <?php if($this->isadd == '0'){echo 'selected="selected"';}?>>删除</option>
		        <option value='1' <?php if($this->isadd == '1'){echo 'selected="selected"';}?>>增加</option>
	    	</select>
        </div>
        <div class="form-group">
            <label for="date">日期:</label>
            <input class="form-control" type="text" name="starttime" onclick="new Calendar().show(this);" readonly="readonly" value="<?php echo $this->starttime;?>">
	               至<input class="form-control" type="text" name="endtime" onclick="new Calendar().show(this);" readonly="readonly" value="<?php echo $this->endtime;?>">
        </div>
        <button type="submit" class="btn btn-primary">搜索</button>
    </form>
    <div class="table-responsive">
        <table class="table table-bordered table-hover">
            <thead>
                <tr>
                    <th>SKU</th>
                    <th>产品名称</th>
                    <th>操作</th>
                    <th>操作时间</th>
                    <th>操作员</th>
                </tr>
            </thead>
            <tbody>      
                <?php if ($this->deladdList):?>
                <?php foreach ($this->deladdList as $v):?>
                <tr>
                    <td><?php echo $v['sku'];?></td>
                    <td><?php echo $v['title'];?></td>
                    <td><?php if($v['isadd']){echo '增加';}else{echo '删除';}?></td>
				    <td><?php echo $v['add_time']; ?></td>
				    <td><?php echo $v['add_user']; ?></td>
			    </tr>
			    <?php endforeach;?> 
			    <?php endif;?>
			    <tr>
			        <td colspan="7">
			        <?php
					     echo $this->paginationControl ( $this->paginator, 'Sliding', 'page/pager.phtml', array (
						    'isadd' => $this->isadd,
						    'starttime' => $this->starttime,
						    'endtime' => $this->endtime 
				    	) );
				    ?>
			        </td>
			    </tr>
		    </tbody>
        </table>
    </div>
</div>
</div>
